﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace CoursePack
{
    [Serializable]
    public class Semester
    {

        private int MAX_CREDITS_ALLOWED;
        private Session m_Session;
        private StudentSchedule m_Schedule;

        public Semester(Session _Session, int _CreditsAllowed)
        {
            this.m_Schedule = new StudentSchedule();
            this.m_Session = _Session;
            MAX_CREDITS_ALLOWED = _CreditsAllowed;
           
        }

        #region Accessors
        public ESession Session
        {
            get { return this.m_Session.ESession; }
        }

        public int Year
        {
            get { return this.m_Session.Year; }
        }

        public float TotalCredits
        {
            get
            {   
                float result = 0;
                foreach (Course c in this.m_Schedule.Courses)
                {
                    result += c.Credits;
                }
                return result;
            }
        }

        public StudentSchedule Schedule
        {
            get { return this.m_Schedule; }
            set { this.m_Schedule = value; }
        }
        #endregion
    }
}
